package com.manager.service.imp;

import com.common.result.BaseResult;
import com.manager.dao.GoodsMapper;
import com.manager.pojo.Goods;
import com.manager.pojo.GoodsCategory;
import com.manager.service.goodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
@Service
public class goodServiceImpl implements goodService {
    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public List<GoodsCategory> goodsCategoryList() {
        return null;
    }

    /**
     * 商品列表->新增商品
     * @param goods
     * @return
     */
    @ResponseBody
    @Override
    public BaseResult save(Goods goods) {
        int result = goodsMapper.insertSelective(goods);
        return result>0?BaseResult.success():BaseResult.error();
    }
}
